home *** CD-ROM | disk | FTP | other *** search
-
-
-
- pppp2222ooooppppeeeennnn((((3333GGGG)))) pppp2222ooooppppeeeennnn((((3333GGGG))))
-
-
-
- NNNNAAAAMMMMEEEE
- _pppp_2222_oooo_pppp_eeee_nnnn, _pppp_2222_cccc_llll_oooo_ssss_eeee - open, close pipes to and from a command
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- _cccc_cccc [_f_l_a_g ...] _f_i_l_e ... _----_llll_gggg_eeee_nnnn [_l_i_b_r_a_r_y ...]
-
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_llll_iiii_bbbb_gggg_eeee_nnnn_...._hhhh_>>>>
-
- _iiii_nnnn_tttt _pppp_2222_oooo_pppp_eeee_nnnn _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_c_m_d_,,,, _FFFF_IIII_LLLL_EEEE _****_f_p_[[[[_2222_]]]]_))))_;;;;
-
- _iiii_nnnn_tttt _pppp_2222_cccc_llll_oooo_ssss_eeee _((((_FFFF_IIII_LLLL_EEEE _****_f_p_[[[[_2222_]]]]_))))_;;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _pppp_2222_oooo_pppp_eeee_nnnn forks and execs a shell running the command line pointed to by
- _c_m_d. On return, _f_p_[[[[_0000_]]]] points to a _FFFF_IIII_LLLL_EEEE pointer to write the command's
- standard input and _f_p_[[[[_1111_]]]] points to a _FFFF_IIII_LLLL_EEEE pointer to read from the
- command's standard output. In this way the program has control over the
- input and output of the command.
-
- The function returns 0 if successful; otherwise it returns -1.
-
- _pppp_2222_cccc_llll_oooo_ssss_eeee is used to close the file pointers that _pppp_2222_oooo_pppp_eeee_nnnn opened. It waits
- for the process to terminate and returns the process status. It returns
- 0 if successful; otherwise it returns -1.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_tttt_dddd_iiii_oooo_...._hhhh_>>>>
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_llll_iiii_bbbb_gggg_eeee_nnnn_...._hhhh_>>>>
- _mmmm_aaaa_iiii_nnnn_((((_aaaa_rrrr_gggg_cccc_,,,,_aaaa_rrrr_gggg_vvvv_))))
- _iiii_nnnn_tttt _aaaa_rrrr_gggg_cccc_;;;;
- _cccc_hhhh_aaaa_rrrr _****_****_aaaa_rrrr_gggg_vvvv_;;;;
- _{{{{
- _FFFF_IIII_LLLL_EEEE _****_ffff_pppp_[[[[_2222_]]]]_;;;;
- _pppp_iiii_dddd______tttt _pppp_iiii_dddd_;;;;
- _cccc_hhhh_aaaa_rrrr _bbbb_uuuu_ffff_[[[[_1111_6666_]]]]_;;;;
- _pppp_iiii_dddd_====_pppp_2222_oooo_pppp_eeee_nnnn_((((_""""_////_uuuu_ssss_rrrr_////_bbbb_iiii_nnnn_////_cccc_aaaa_tttt_""""_,,,, _ffff_pppp_))))_;;;;
- _iiii_ffff _(((( _pppp_iiii_dddd _!!!!_==== _0000 _)))) _{{{{
- _ffff_pppp_rrrr_iiii_nnnn_tttt_ffff_((((_ssss_tttt_dddd_eeee_rrrr_rrrr_,,,, _""""_pppp_2222_oooo_pppp_eeee_nnnn _ffff_aaaa_iiii_llll_eeee_dddd_\\\\_nnnn_""""_))))_;;;;
- _eeee_xxxx_iiii_tttt_((((_1111_))))_;;;;
- _}}}}
- _wwww_rrrr_iiii_tttt_eeee_((((_ffff_iiii_llll_eeee_nnnn_oooo_((((_ffff_pppp_[[[[_0000_]]]]_))))_,,,,_""""_TTTT_hhhh_iiii_ssss _iiii_ssss _aaaa _tttt_eeee_ssss_tttt_\\\\_nnnn_""""_,,,, _1111_6666_))))_;;;;
- _iiii_ffff_((((_rrrr_eeee_aaaa_dddd_((((_ffff_iiii_llll_eeee_nnnn_oooo_((((_ffff_pppp_[[[[_1111_]]]]_))))_,,,, _bbbb_uuuu_ffff_,,,, _1111_6666_)))) _<<<<_====_0000_))))
- _ffff_pppp_rrrr_iiii_nnnn_tttt_ffff_((((_ssss_tttt_dddd_eeee_rrrr_rrrr_,,,, _""""_pppp_2222_oooo_pppp_eeee_nnnn _ffff_aaaa_iiii_llll_eeee_dddd_\\\\_nnnn_""""_))))_;;;;
- _eeee_llll_ssss_eeee
- _wwww_rrrr_iiii_tttt_eeee_((((_1111_,,,, _bbbb_uuuu_ffff_,,,, _1111_6666_))))_;;;;
- _((((_vvvv_oooo_iiii_dddd_))))_pppp_2222_cccc_llll_oooo_ssss_eeee_((((_ffff_pppp_))))_;;;;
- _}}}}
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- pppp2222ooooppppeeeennnn((((3333GGGG)))) pppp2222ooooppppeeeennnn((((3333GGGG))))
-
-
-
- SEE ALSO
- _ffff_cccc_llll_oooo_ssss_eeee(3S), _pppp_oooo_pppp_eeee_nnnn(3S), _ssss_eeee_tttt_bbbb_uuuu_ffff(3S)
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- A common problem is having too few file descriptors. _pppp_2222_cccc_llll_oooo_ssss_eeee returns -1
- if the two file pointers are not from the same _pppp_2222_oooo_pppp_eeee_nnnn.
-
- NNNNOOOOTTTTEEEESSSS
- Buffered writes on _f_p_[[[[_0000_]]]] can make it appear that the command is not
- listening. Judiciously placed _ffff_ffff_llll_uuuu_ssss_hhhh calls or unbuffering _f_p_[[[[_0000_]]]] can be a
- big help; see _ffff_cccc_llll_oooo_ssss_eeee(3S).
-
- Many commands use buffered output when connected to a pipe. That, too,
- can make it appear as if things are not working.
-
- Usage is not the same as for _pppp_oooo_pppp_eeee_nnnn, although it is closely related.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-